package com.itljm.cxrMarket.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itljm.cxrMarket.entity.SysPermission;
import com.itljm.cxrMarket.service.SysPermissionService;
import com.itljm.cxrMarket.mapper.SysPermissionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, SysPermission> implements SysPermissionService{
    @Autowired
    private SysPermissionMapper sysPermissionMapper;
    @Override
    public List<SysPermission> selectPermissionPage(Page<SysPermission> page, Wrapper<SysPermission> entityWrapper) {
        return sysPermissionMapper.selectPermissionPage(page,entityWrapper);
    }

    @Override
    public boolean addOrUpdate(SysPermission sysPermission) {
        return sysPermissionMapper.insertOrUpdate(sysPermission);
    }

    @Override
    public boolean deleteById(Long id) {
        return sysPermissionMapper.deleteById(id) > 0;
    }

    @Override
    public SysPermission selectById(Long id) {
        return sysPermissionMapper.selectById(id);
    }
}




